From b870897ede2d443aea28ab5c2bf60c67768a703a Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 24 Aug 2005 16:15:42 +0000 Subject: [PATCH] Print status of Flush Filter on AMD64 processors during Xen boot. Also provide a new boot parameter: amd_flush_filter=on : Forcibly enable the Filter amd_flush_filter=off : Forcibly disable the Filter Signed-off-by: Keir Fraser --- xen/arch/x86/cpu/amd.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index 4b49e17f37..9692d6712d 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -9,6 +9,20 @@ #include "cpu.h" +/* + * amd_flush_filter={on,off}. Forcibly Enable or disable the TLB flush + * filter on AMD 64-bit processors. + */ +static int flush_filter_force; +static void flush_filter(char *s) +{ + if (!strcmp(s, "off")) + flush_filter_force = -1; + if (!strcmp(s, "on")) + flush_filter_force = 1; +} +custom_param("amd_flush_filter", flush_filter); + #define num_physpages 0 /* @@ -192,6 +206,21 @@ static void __init init_amd(struct cpuinfo_x86 *c) break; } + if (c->x86 == 15) { + rdmsr(MSR_K7_HWCR, l, h); + printk(KERN_INFO "CPU%d: AMD Flush Filter %sabled", + smp_processor_id(), (l & (1<<6)) ? "dis" : "en"); + if ((flush_filter_force > 0) && (l & (1<<6))) { + l &= ~(1<<6); + printk(" -> Forcibly enabled"); + } else if ((flush_filter_force < 0) && !(l & (1<<6))) { + l |= 1<<6; + printk(" -> Forcibly disabled"); + } + wrmsr(MSR_K7_HWCR, l, h); + printk("\n"); + } + display_cacheinfo(c); if (cpuid_eax(0x80000000) >= 0x80000008) { -- 2.30.2